<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui" template="/pages/template.xhtml">

    <ui:define name="screen">

        <h:form prependId="false" id="cadastroUsuario">

            <p:growl id="growl" />
            <p:focus /> 

            <p:panel header="Alterar Senha" >

                <h:panelGrid columns="1" id="grid" >
                        
                    <h:outputLabel for="Id" value="Usuário" />                    
                    <p:commandButton image="ui-icon ui-icon-extlink" title="Consutar" tabindex="-1" ajax="false" 
                                     action="#{alterarSenhaAction.consultaUsuario}">                    
                        <p:inputText id="id" readonly="true"
                                 value="#{alterarSenhaAction.alterarSenhaVo.usuarioVo.id}" />                    
                    </p:commandButton>
                    
                    <p:message for="id" />                    

                    <h:outputLabel for="nome" value="Nome" />
                    <p:inputText id="nome" readonly="true" 
                                 value="#{alterarSenhaAction.alterarSenhaVo.usuarioVo.nome}" />                     
                    <p:message for="nome" />

                    <h:outputLabel for="email" value="E-mail" />
                    <p:inputText id="email" readonly="true"  
                                 value="#{alterarSenhaAction.alterarSenhaVo.usuarioVo.email}" />                     
                    <p:message for="email" />                    
                    
                    <h:outputLabel for="atualSenha" value="Atual Senha" />
                    <p:password id="atualSenha" feedback="false" 
                                value="#{alterarSenhaAction.alterarSenhaVo.atualSenha}" />                     
                    <p:message for="atualSenha" />
                    
                    <h:outputLabel for="novaSenha" value="Nova Senha" />
                    <p:password id="novaSenha" 
                                value="#{alterarSenhaAction.alterarSenhaVo.novaSenha}"                   
                                feedback="true" promptLabel="Informe a nova senha" inline="false"
                                weakLabel="Fraca" goodLabel="Média" strongLabel="Ótima" 
                                 />
                    <p:message for="novaSenha" />

                    <h:outputLabel for="confirmacaoSenha" value="Confirmação da senha" />
                    <p:password id="confirmacaoSenha" feedback="false"
                                value="#{alterarSenhaAction.alterarSenhaVo.confirmacaoSenha}" />                     
                    <p:message for="confirmacaoSenha" />        

                </h:panelGrid>
                
                 <p:commandButton value="Alterar" image="ui-icon ui-icon-disk" title="Salvar" ajax="false" update="grid,growl"
                                  action="#{alterarSenhaAction.alterar}" />

                <p:commandButton image="ui-icon ui-icon-refresh" title="Limpar" update="grid" process="@this" tabindex="-1"
                                 action="#{alterarSenhaAction.limpar}" />
                
            </p:panel>

        </h:form>

        <h:form>
            <p:commandButton value="Principal" image="ui-icon ui-icon-home" title="Principal" ajax="false" action="principal" />          
        </h:form> 

    </ui:define>

</ui:composition>
